<script lang="ts" setup>
import pageHeader from "@/components/pageHeader.vue";
import VueQr from "vue-qr/src/packages/vue-qr.vue";
import { copy } from "@/utils/copy";
import { Ref, onMounted, ref, watch, computed } from "vue";
import i18n from "@/i18n";
import { gameList, czRechargeGetChargeWallet, fundTransfer } from "@/api/games";
import navTo from "@/utils/navTo";
const walletInfo = ref(null);

const getCzRechargeGetChargeWallet = async () => {
  try {
    let res = await czRechargeGetChargeWallet({});
    console.log("czRechargeGetChargeWallet:", res.value);
    walletInfo.value = res.value.data;
  } catch (error) {}
};

onMounted(() => {
  getCzRechargeGetChargeWallet();
});
</script>

<template>
  <div class="page">
    <pageHeader>
      <template #title>{{ i18n.global.t("RechargeT1") }}</template>
      <template #right
        ><img
          @click="navTo('/recharge/record')"
          class="rightInfo"
          src="@/assets/images/info.svg"
      /></template>
    </pageHeader>
    <div class="content">
      <div class="box">
        <div class="top">{{ i18n.global.t("RechargeT2") }} USDT-BEP20</div>
        <VueQr
          class="qrCode"
          :text="walletInfo ? walletInfo.wallet : ''"
          qid="VueQrid"
        />
        <div class="addr">{{ walletInfo ? walletInfo.wallet : "--" }}</div>
        <div class="copyBtn" @click="copy(walletInfo && walletInfo.wallet)">
          {{ i18n.global.t("RechargeT3") }}
        </div>
      </div>
    </div>
    <div class="content1 top20">
      <div class="txt1">{{ i18n.global.t("RechargeT4") }}</div>
      <div class="txt2">
        {{ i18n.global.t("RechargeT5") }}
      </div>
      <div class="txt2">
        {{ i18n.global.t("RechargeT6") }}
      </div>
    </div>
  </div>
</template>

<style scoped lang="scss">
@import "@/assets/style/constant.scss";
.page {
  width: 100%;
  min-height: 100vh;
  background-color: #1a2c38;
  .top20 {
    margin-top: 20 * $_ru;
  }
  .content {
    padding: 126 * $_ru 30 * $_ru 20 * $_ru 30 * $_ru;
    .box {
      padding: 10 * $_ru 0 30 * $_ru 0;
      background: #0f212e;
      border-radius: 12 * $_ru;
      display: flex;
      flex-direction: column;
      align-items: center;
      .top {
        width: 100%;
        padding: 20 * $_ru 0;
        font-size: 28 * $_ru;
        color: #fff;
        font-size: 600;
        text-align: center;
        border-bottom: 1 * $_ru solid #1a2c38;
      }
      .qrCode {
        margin: 30 * $_ru 0;
        width: 60%;
      }
      .addr {
        max-width: 60%;
        font-size: 24 * $_ru;
        color: #fff;
        font-size: 400;
        text-align: center;
        word-wrap: break-word;
      }
      .copyBtn {
        width: 40%;
        padding: 20 * $_ru 0;
        background: #1a2c38;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28 * $_ru;
        color: #fff;
        font-size: 600;
        margin-top: 20 * $_ru;
        border-radius: 12 * $_ru;
      }
    }
  }
  .content1 {
    padding: 0 * $_ru 30 * $_ru 120 * $_ru 30 * $_ru;
    .txt1 {
      font-size: 26 * $_ru;
      color: #fff;
      font-size: 600;
    }
    .txt2 {
      font-size: 24 * $_ru;
      color: #fff;
      font-size: 400;
      word-wrap: break-word;
      margin-top: 20 * $_ru;
      line-height: 30 * $_ru;
    }
  }
}
</style>
